<template>
    <div class="selectModalList-wrapper">
        <div class="d-menu">
            <div class="d-list" v-for="(list, index) in selectItems" :key="list.id" @click="choice(list, index)">{{
                list.name
            }}</div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        selectItems: {
            type: Array,
            require: true,
            default: [
                {
                    name: '选择一',
                    code: '001'
                },
                {
                    name: '选择二',
                    code: '002'
                },
            ]
        }
    },
    components: {
    },
    data () {
        return {
        }
    },
    computed: {

    },
    watch: {

    },
    created () {

    },
    mounted () {

    },
    methods: {
        choice (list, i) {
            this.$emit('sure', list)
        }
    },
    activated () { },
}
</script>

<style lang='scss' scoped>
@import '../varConfig.scss';

.selectModalList-wrapper {
    position: absolute;
    background: #FFF;
    min-width: 150px;
    border: 1px solid #EBEEF5;
    z-index: 2000;
    color: #606266;
    line-height: 1.4;
    text-align: justify;
    font-size: 14px;
    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
    word-break: break-all;

    .d-menu {
        .d-list {
            padding: 0 20px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            height: 35px;
            line-height: 35px;
            font-size: 14px;
            color: rgb(37, 43, 58);
            cursor: pointer;

            &:hover {
                color: $hoverFontColor;
                background-color: #f2f5fc;
            }

            &.active {
                color: #fff;
                background-color: #5e80e0;
            }
        }
    }
}
</style>